import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    redirect: '/admin/login', //重定向
    children: [
        //首页页面
      {
        path: '/',
        component: () => import('../views/admin/homepage/HomePageView.vue')
      },
        //登录页面
      {
        path: '/admin/login',
        component: () => import('../views/admin/loginpage/LoginView.vue')
      },
      //医生信息管理页面
      {
        path: '/admin/select/doctor',
        component: () => import('../views/admin/doctor/DoctorManagementView.vue')
      },
        //病床利用率查询页面
      {
        path: '/admin/select/bedUseRatio',
        component: () => import('../views/admin/statistics/BedUseRatioQueryView.vue')
      },
      //收费信息添加页面
      {
        path: '/admin/feebasedcontent/FreeBasedAddNewView',
        component: () => import('../views/admin/feebasedcontent/FreeBasedAddNewView')
      },
        //收费明细查询页面
      {
        path: '/admin/select/chargeDetail',
        component: () => import('../views/admin/statistics/ChargeDetailQueryView.vue')
      },
      {
        path: '/admin/patient',
        component: () => import('../views/admin/patient/PatientListView.vue')
      },
      ,
      {
        path: '/admin/patient/add-new',
        component: () => import('../views/admin/patient/PatientAddNewView.vue')
      },
        //病床查询
      {
        path: '/admin/select/bed',
        component: () => import('../views/admin/hospitalbed/BedQueryView.vue')
      },
        //病床添加
      {
        path: '/admin/hospitalbed/bedadd',
        component: () => import('../views/admin/hospitalbed/BedAddView.vue')
      },
      //收费信息查询页面
      {
        path: '/admin/feebasedcontent/FreeBasedView',
        component: () => import('../views/admin/feebasedcontent/FreeBasedView.vue')
      },
      {
        path: '/admin/user/add-new',
        component: () => import('../views/admin/doctor/DoctorAddNewView')
      },
    ]
  },
    // 注册界面
  {
    path: '/admin/EnrollView',
    component: () => import('../views/admin/loginpage/EnrollView')
  },
    // 修改密码界面
  {
    path: '/ChangePassword',
    component: () => import('../views/ChangePassword.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
